<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="sitemesh" uri="http://www.opensymphony.com/sitemesh/decorator"%>
<!doctype html>
<html lang="en">
<head>
	<link rel="shortcut icon" href="${ctx}/statics/imgs/favicon.ico" type="image/x-icon">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta charset="UTF-8">
	<meta name="viewport"
		  content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
	<meta http-equiv="X-UA-Compatible" content="IE=9" />
    <link rel="stylesheet" href="${ctx}/statics/libs/layui/css/modules/sign/iconfont.css?v=${v}">
	<link rel="stylesheet" href="${ctx}/statics/libs/layui/css/layui.css?v=${v}">
	<link rel="stylesheet" href="${ctx}/statics/less/layui-theme-custom.css?v=${v}">
	<link rel="stylesheet" href="${ctx}/statics/less/base.css?v=${v}">

	<script src="${ctx}/statics/libs/jquery.min.js?v=${v}"></script>
    <script type="text/javascript" src="${ctx}/statics/libs/babel/browser.min.js"></script>
    <script type="text/javascript" src="${ctx}/statics/libs/babel/browser-polyfill.min.js"></script>
    <script type="text/javascript" src="${ctx}/statics/libs/babel/bluebird.js"></script>

	<script src="${ctx}/statics/libs/layui/layui.js?v=${v}"></script>
	<script type="text/babel" src="${ctx}/statics/js/tool.js?v=${v}"></script>
	<!--[if lt IE 8]>
	 <script>
		document.write("<div style='width: 99.8%; height: 99.9%;z-index: 999;position: absolute;background-color: #fff;'><div style='width: 584px;height: 419px;margin: 100px auto;background-color: #ff5522;'><p style='position: absolute;width: 500px;margin: 50px 50px;font-size: 24px;color: #fff;'>您当前的浏览器版本过低，可能存在安全风险，建议升级浏览器或使用其他浏览器：<a href='#' style='display: inline-block;padding: 0 10px;margin: 20px;border: 2px solid #fff;color: #fff'>IE高版本</a><a href='${ctx}/statics/Chrome_Google_v49.0.2623.112.exe' style='display: inline-block;padding: 0 10px;margin: 20px;border: 2px solid #fff;color: #fff'>谷歌浏览器</a></p></div></div>");
	</script>
	<![endif]-->
	<!--[if lt IE 9]>
	  <script src="${ctx}/statics/libs/html5shiv.min.js"></script>
	<script src="${ctx}/statics/libs/respond.min.js"></script>
	<![endif]-->
<script type="text/javascript">
	var ctx = '${ctx}';
	var authStr='${sessionScope.FRAMEWORK__KEY_USERID.userAuthList}';
	authStr=authStr.replace("[","").replace("]","");
</script>
	<sitemesh:head />
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <%-- 顶部导航 --%>
    <div class="layui-header">
        <div class="layui-logo"><a href="${ctx}/"><img src="${ctx}/statics/imgs/logo.png" alt="YAGEO"></a></div>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item shift-icon">
                <a href="javascript:;" class="day-shift" style="display: none;">
                    <span>
                        <svg style="position: relative;top: 0.1rem;" t="1613962344704" class="icon" viewBox="0 0 1030 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="816" width="32" height="32"><path d="M526.222222 182.781893c-15.27572 0-25.283951-10.00823-25.28395-20.016461V32.131687c0-10.00823 10.00823-20.016461 25.28395-20.016461s25.283951 10.00823 25.283951 20.016461v125.366255c0 15.27572-10.00823 25.283951-25.283951 25.283951z m0 841.218107c-15.27572 0-25.283951-10.00823-25.28395-20.016461v-125.366255c0-10.00823 10.00823-20.016461 25.28395-20.016461s25.283951 10.00823 25.283951 20.016461v125.366255c0 10.00823-10.00823 20.016461-25.283951 20.016461z" fill="#F6BB42" p-id="817"></path><path d="M280.757202 277.596708c-10.00823 10.00823-20.016461 10.00823-30.024692 0L165.399177 192.790123c-10.00823-10.00823-10.00823-25.283951 0-30.024691 10.00823-10.00823 20.016461-10.00823 30.024691 0L286.024691 252.839506c4.740741 4.740741 4.740741 20.016461-5.267489 24.757202z m596.279835 596.279835c-10.00823 10.00823-20.016461 10.00823-30.024691 0l-90.074074-90.074074c-10.00823-10.00823-10.00823-20.016461 0-30.024691s20.016461-10.00823 30.024691 0l90.074074 90.074074c10.00823 10.00823 10.00823 24.757202 0 30.024691z" fill="#FFCE54" p-id="818"></path><path d="M185.415638 523.061728c0 15.27572-10.00823 25.283951-20.016461 25.283951H35.292181c-10.00823 0-20.016461-10.00823-20.016461-25.283951s10.00823-25.283951 20.016461-25.28395h125.366255c14.748971 0.526749 24.757202 10.534979 24.757202 25.28395z m841.744856 0c0 15.27572-10.00823 25.283951-20.016461 25.283951h-125.366255c-10.00823 0-20.016461-10.00823-20.016461-25.283951s10.00823-25.283951 20.016461-25.28395h125.366255c10.00823 0.526749 20.016461 10.534979 20.016461 25.28395z" fill="#F6BB42" p-id="819"></path><path d="M280.757202 758.518519c10.00823 10.00823 10.00823 20.016461 0 30.024691l-90.074074 90.074074c-10.00823 10.00823-20.016461 10.00823-30.024692 0-10.00823-10.00823-10.00823-20.016461 0-30.024691L250.73251 758.518519c10.00823-10.00823 25.283951-10.00823 30.024692 0zM877.037037 162.765432c10.00823 10.00823 10.00823 20.016461 0 30.024691l-90.074074 90.074075c-10.00823 10.00823-20.016461 10.00823-30.024691 0s-10.00823-20.016461 0-30.024692l90.074074-90.074074c10.00823-10.00823 24.757202-10.00823 30.024691 0zM520.954733 793.8107c-150.123457 0-275.489712-125.366255-275.489712-275.489712s125.366255-275.489712 275.489712-275.489712 275.489712 125.366255 275.489711 275.489712-124.839506 275.489712-275.489711 275.489712z" fill="#FFCE54" p-id="820"></path><path d="M520.954733 222.814815c-165.399177 0-295.506173 130.106996-295.506173 295.506173s130.106996 295.506173 295.506173 295.506172S816.460905 683.193416 816.460905 518.320988s-134.847737-295.506173-295.506172-295.506173z m180.674897 475.654321c-50.041152 50.041152-110.090535 75.325103-180.148149 75.325103-65.316872 0-130.106996-25.283951-180.148148-75.325103s-75.325103-110.090535-75.325103-180.148148 25.283951-130.106996 75.325103-180.148148S451.423868 262.847737 521.481481 262.847737c65.316872 0 130.106996 25.283951 180.148149 75.325103s75.325103 110.090535 75.325103 180.148148-30.55144 130.106996-75.325103 180.148148z" fill="#F6BB42" p-id="821"></path></svg>
                    </span>
                    <span>白班</span>
                </a>
                <a href="javascript:;" class="night-shift" style="display: none;">
                    <span>
                        <svg style="position: relative;top: 0.1rem;" t="1613962764994" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="993" width="32" height="32"><path d="M565 200.4c25.6 44.6 40.4 96.2 40.4 151.3 0 167.9-136.1 304-304 304-22.9 0-45.2-2.6-66.7-7.4C284.5 760.7 397 839.2 527.8 839.2c177 0 320.5-143.5 320.5-320.5 0-164.4-123.8-299.8-283.3-318.3z m-252.1 43.2h-39.2v-39.2c0-10.8-8.8-19.6-19.6-19.6s-19.6 8.8-19.6 19.6v39.2h-39.2c-10.8 0-19.6 8.8-19.6 19.6s8.8 19.6 19.6 19.6h39.2V322c0 10.8 8.8 19.6 19.6 19.6s19.6-8.8 19.6-19.6v-39.2h39.2c10.8 0 19.6-8.8 19.6-19.6s-8.8-19.6-19.6-19.6z" fill="#FFF0C2" p-id="994"></path><path d="M306.9 245.6h-35.2v-35.2c0-9.7-7.9-17.6-17.6-17.6-9.7 0-17.6 7.9-17.6 17.6v35.2h-35.2c-9.7 0-17.6 7.9-17.6 17.6 0 9.7 7.9 17.6 17.6 17.6h35.2V316c0 9.7 7.9 17.6 17.6 17.6 9.7 0 17.6-7.9 17.6-17.6v-35.2h35.2c9.7 0 17.6-7.9 17.6-17.6 0-9.7-7.9-17.6-17.6-17.6z" fill="#FFC445" p-id="995"></path><path d="M427.8 475.3h-27.5v-27.5c0-7.6-6.2-13.8-13.8-13.8-7.6 0-13.8 6.2-13.8 13.8v27.5h-27.5c-7.6 0-13.8 6.2-13.8 13.8 0 7.6 6.2 13.8 13.8 13.8h27.5v27.5c0 7.6 6.2 13.8 13.8 13.8 7.6 0 13.8-6.2 13.8-13.8v-27.5h27.5c7.6 0 13.8-6.2 13.8-13.8 0-7.6-6.2-13.8-13.8-13.8z" fill="#FFF0C2" p-id="996"></path><path d="M423.6 476.7h-24.7V452c0-6.8-5.5-12.4-12.4-12.4-6.8 0-12.4 5.5-12.4 12.4v24.7h-24.7c-6.8 0-12.4 5.5-12.4 12.4 0 6.8 5.5 12.4 12.4 12.4h24.7v24.7c0 6.8 5.5 12.4 12.4 12.4 6.8 0 12.4-5.5 12.4-12.4v-24.7h24.7c6.8 0 12.4-5.5 12.4-12.4 0-6.8-5.5-12.4-12.4-12.4z" fill="#FFC445" p-id="997"></path><path d="M563.4 223c23.8 41.4 37.5 89.4 37.5 140.6 0 156-126.5 282.5-282.5 282.5-21.3 0-42-2.4-62-6.9 46.3 104.5 150.8 177.4 272.4 177.4 164.5 0 297.9-133.4 297.9-297.9 0-152.7-115.1-278.6-263.3-295.7z" fill="#FFB948" p-id="998"></path></svg>
                    </span>
                    <span>夜班</span>
                </a>
            </li>
            <li class="layui-nav-item sys-time">
                <a href="javascript:;">
                    <span></span>
                </a>
            </li>
            <li class="layui-nav-item"><a href="javascript:;">${sessionScope.username}</a></li>
            <li class="layui-nav-item"><a href="javascript:;" id="logout">退出</a></li>
        </ul>
        <div id="scrollFlash" class="scrollFlash">
            <ul class="ulFlash"></ul>
        </div>
    </div>
    <%-- 侧边导航 --%>
    <div class="layui-side close">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree"  lay-filter="left-side-nav" lay-shrink="all">
                <li class="layui-nav-item"><a href="${ctx}/"><i class="icon layui-icon layui-icon-chart-screen"></i>综合大屏</a></li>
<%--                <li class="layui-nav-item">--%>
<%--                    <a href="javascript:;"><i class="icon layui-icon layui-icon-template-1"></i>设备管理</a>--%>
<%--                    <dl class="layui-nav-child line-info">--%>
<%--                        <dd><a href="${ctx}/meterManager/meterManagerIndex.do" class="dev-set">参数设置</a></dd>--%>
<%--                    </dl>--%>
<%--                </li>--%>
                <li class="layui-nav-item"><a href="${ctx}/userManger/userManger.do"><i class="icon layui-icon layui-icon-friends"></i>用户管理</a></li>
                <li class="layui-nav-item visitor-list" style="overflow-x: hidden;">
                    <dl class="layui-clear" style="padding: 0 10px;">
                        <dd style="height:30px;line-height: 30px;">当前访客：</dd>
                        <dd style="height:30px;    line-height: 30px;margin-right: 8px;float: left"><i class="layui-icon layui-icon-username" style="border: 1px solid #fff;border-radius: 50%;"></i>${sessionScope.username}</dd>
                    </dl>
                </li>
            </ul>
            <div class="jyt" style="text-align: center;">佳运通电子科技</div>
            <div id="triangle" title="点击此处展开/收起侧边栏">
                <i class="layui-icon layui-icon-triangle-r"></i>
            </div>
        </div>
    </div>
    <div class="layui-body">
        <div class="page-top"><a href="${ctx}/integrate/integrateIndex.do" style="color:#fff;">FQC電子看板</a></div>
        <sitemesh:body />
    </div>
</div>
</body>
</html>
<%--<script type="text/babel" src="${ctx}/statics/js/default.js"></script>--%>
<script type="text/babel">
    $(function () {
        layui.use(['element','util','locals'], function(){
            var element = layui.element,
                util = layui.util,
                locals = layui.locals;

            // 导航小三角 icon
            // $('.layui-header .layui-nav-item').find('.layui-nav-more').html('<i class="layui-icon layui-icon-down"></i>');
            $('.layui-header .layui-nav-item').find('.layui-nav-more').attr('class','triangle layui-icon layui-icon-down');
            var lis = $('.layui-side .layui-nav-item');
            for (var i = 0; i < lis.length; i++) {
                var el = $(lis[i]);
                if(el.hasClass('layui-nav-itemed')){
                    el.find('.layui-nav-more').html('<i class="layui-icon layui-icon-up"></i>');
                    var dd = el.children('dd');
                    if(dd.length > 0){
                        if(dd.hasClass('layui-nav-itemed')){
                            dd.find('.layui-nav-more').html('<i class="layui-icon layui-icon-up"></i>');
                        }else{
                            dd.find('.layui-nav-more').html('<i class="layui-icon layui-icon-down"></i>');
                        }
                    }
                }else{
                    el.find('.layui-nav-more').html('<i class="layui-icon layui-icon-down"></i>');
                }
            }
            $('.layui-side .layui-nav-item').on('click',function (event) {
                if($(this).hasClass('layui-nav-itemed')){
                    $(this).children('a').find('.layui-nav-more').html('<i class="layui-icon layui-icon-up"></i>');
                }else{
                    $(this).children('a').find('.layui-nav-more').html('<i class="layui-icon layui-icon-down"></i>');
                }
            });
            // 侧边导航 - 三级
            $("body").on("click", '.menu_three',function () {
                var dd = $(this).parent();
                if(dd.hasClass('layui-nav-itemed')){
                    $(this).find('.layui-nav-more').html('<i class="layui-icon layui-icon-up"></i>');
                    dd.siblings().find('.layui-nav-more').html('<i class="layui-icon layui-icon-down"></i>');
                    $(this).next().css('display','block');
                    dd.siblings().find("ol").css('display','none');
                }else{
                    $(this).find('.layui-nav-more').html('<i class="layui-icon layui-icon-down"></i>');
                    $(this).next().css('display','none');
                }
            });
            $("ol").on("click", "li a", function () {
                $.each($(this).parent().siblings(), function (i, e) {
                    $(e).find("a").removeClass('three_this')
                });
                $(this).addClass('active'); // 添加当前元素的样式
            });

            var pathname = window.location.pathname;
            // if(pathname == '/'){ // 主页重定向
            //     window.location.href = '/integrate/integrateIndex.do'
            // }
            // 设置网页title
            let titleText = $(".layui-side li a[href='"+ pathname +"']").text();
            let pageTitle = '<title>' + titleText + '</title>';
            $('head').prepend(pageTitle);

            // 退出登录
            $("body").on("click","#logout",function(){
                $.ajax({
                    type:"post",
                    url: ctx+"/logout.do",
                    data:{},
                    async:	true,
                    cache: false,
                    dataType:"json",
                    beforeSend:function(){
                        //layer.load(2);
                    },success:function(data){
                        if(data.code=="000000"){
                            window.localStorage.clear();
                            location.reload();
                        }else{
                            alert("系统异常，"+data.message);
                        }
                    },error:function(e){
                        alert("系统异常，请稍后再试");
                    }
                });
            });

            // 系统时间
            setInterval(function(){
                $('.sys-time span').text(util.toDateString(new Date()));
                let hour = new Date().getHours();  //  0 ~ 23
                // 早8~晚8 为白班，其余夜班
                if(hour >= 8 && hour <= 20 ){
                    $('.shift-icon > .day-shift').show();
                    $('.shift-icon > .night-shift').hide();
                }else{
                    $('.shift-icon > .day-shift').hide();
                    $('.shift-icon > .night-shift').show();
                }
            },1000);


            $('#triangle i').click(function(){
                $('.layui-side').toggleClass('close');
                let isClose = $('.layui-side').hasClass('close');
                locals.set('isClose', isClose);
                if(!isClose){ // 侧边栏展开时，给当前nav加active样式
                    let leftNav = $(".layui-side li a[href='"+ pathname +"']");
                    leftNav.addClass("active");
                    leftNav.parents('li').children('a').addClass("active");
                    leftNav.parents('li.layui-nav-item').addClass("layui-nav-itemed");
                }
            });

            function maquee(){
                let list = [
                    {content: '欢迎用户： 系统管理员！'}
                ];
                if (list.length > 0) {
                    $('#scrollFlash').show();
                    var j = 0;
                    while (j < list.length) {
                        var string = '<li>'+ list[j].content +'</li>';
                        $('.ulFlash').append(string);
                        j++;
                    }
                    var h = $('.ulFlash li:first-child').height();
                    if (list.length > 1) {
                        $("div#scrollFlash").myMaquee({
                            speed: 100, // 数值越大，速度越慢
                            rowHeight: h // li的高度
                        });
                    }
                }
            }
            maquee()
        });
    });
</script>